home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Diamond Collection
/
The Diamond Collection (Software Vault)(Digital Impact).ISO
/
cdr42
/
smixw111.zip
/
SMIXW111.DOC
< prev
next >
Wrap
Text File
|
1995-02-24
|
6KB
|
121 lines
_____ __ __ ____ __ __ _ _
/ _ \ | \ / | | | | \ / | | | | |
| / \__| | \/ | | | \ ~ / | | | |
| \___ | | | | | | | | | |
\___ \ | /\/\ | | | | | | | _ | |
__ \ | | | | | | | | | | |/ \| |
| \_/ | | | | | | | / ^ \ | _ |
\_____/ |__| |__| |____| |__/ \__| \__/ \__/
for Watcom C DOS/4GW protected mode
Version 1.11
Written by Ethan Brodsky (2/24/95)
Copyright 1995 by Ethan Brodsky. All rights reserved.
This library is distributed AS IS. The author specifically disclaims
responsibility for any loss of profit or any consequential, incidental,
or other damages. SMIXW is freeware and is distributed with full source
code, which is copyright by Ethan Brodsky. You are free to incorporate
the code in full or part into your own programs as long as credit is
given to Ethan Brodsky. The source code may be distributed in its
original form only, including this documentation and the copyright
notices.
------------------------------------------------------------------------
You may have used my SBVOX and SBDSP units. They both played one VOC
file at a time. The whole VOC file had to be loaded into conventional
memory, taking valuable memory from a real mode program.
SMIXW will play up to 8 simultaneous sounds on a Sound Blaster or
compatible in protected mode. The sounds are stored anywhere in memory
and are mixed into a small buffer as needed. It uses auto initialized
DMA if a SBPro or higher is installed, eliminating clicks between
blocks. On a SB16 is installed, it will use 16-bit sound output,
increasing the sound quality. Full Watcom C code for protected mode
under the DOS/4GW DOS extender is included.
The sounds are stored on disk as raw signed 8-bit sample data at a
sampling rate of 22050 HZ and are loaded anywhere in memory. The
data is mixed into a 16-bit buffer one block at a time, then copied
down to an 8 or 16 bit buffer in conventional memory for DMA output.
Please test this on your setup (Especially if you have a Sound Blaster
compatible, a SB on IRQ10, or something out of the ordinary) and report
any imcompatibilities to me. I have only tested this version on my
SB16, but it should work on other configurations.
As the block size is increased, the sound latency will also increase.
New sound effects are only started at the beginning of each block,
so a block size of 256 gives a latency of about 1/43 of a second.
This is the maximum time that can pass between when the StartSound
procedure is called and when the sound starts playing. In case you are
wondering about the three counters displayed by the test program, the
first one counts in the CPU's free time, the second counts the number
of interrupts that have occurred, and the third is the number of sounds
currently being played. If you have an incompatibility problem, please
tell me what each counter is doing.
SMIXC uses a raw 8-bit unsigned file format. I have included a program
that will convert WAV files to the raw format necessary. The WAV files
must be 8-bit and sampled at 22050 HZ, or the output will be distorted.
One important pointer. The SMIX module MUST be compiled using the "-zu"
compiler switch. The Watcom code generator erroneously assumes that
SS == DS when generating code for an interrupt handler. The compiler
then uses EBP to address data in DS and your program will terminate
with a stack fault upon the first sound interrupt. "-zu" tells the
compiler not to make this assumption and is the best workaround for
this compiler bug. (Another option is to disable optimizations, but
this will cause the compiler to generate terrible code)
I have several improvements planned, but I need feedback. If you are
using my code, I would greatly appreciate it if you would mail me and
tell me about it. If you have any bug reports, suggestions, or have
made improvements, please tell me! I also have finished a FM synthesis
MIDI music library and am working on a digital music library, so tell me
what you are interested in!
This library is freeware, but I would appreciate contributions so I can
continue to buy development kits and upgrade my computer. You don't
NEED to send me anything, but if you are making money using this, please
send whatever you feel that it is worth.
Features:
* Up to 8 sounds played simultaneously
* Sampling rate of 22050 HZ
* Autoinitialized DMA prevents clicking
* 16-bit sound output increases quality
* Mixes in the background using a fraction of CPU time
------------------------------------------------------------------------
There are several ways to contact me:
E-Mail: ericbrodsky@psl.wisc.edu (Preferred)
WWW: http://www.xraylith.wisc.edu/~ebrodsky/
Phone: (608) 238-4830
Mail:
Ethan Brodsky
4010 Cherokee Dr.
Madison, WI 53711
Bug fixes and other announcements will be posted in:
alt.sb.programmer
comp.sys.ibm.pc.soundcard.tech
rec.games.programmer
Up-to-date versions may be downloaded from:
x2ftp.oulu.fi /pub/msdos/programming/mxlibs/smixw*.zip
The directory structure at x2ftp is currently under reorganization
and the file will probably be moved to a different directory.
http://www.xraylith.wisc.edu/~ebrodsky/smix/smix.html
Revision history:
1.11 - Initial release
I've been looking to get in with a commercial software company. If any
companies are interested, write to me at the above address. Thanks!
Ethan Brodsky